<!--
 * @Author: 米爱 1969407518@qq.com
 * @Date: 2025-06-10 11:42:15
 * @LastEditors: 米爱 1969407518@qq.com
 * @LastEditTime: 2025-08-11 21:32:55
 * @FilePath: \CraneOperator-xm\src\views\home.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="home">
    <nav class="navTitle">
      <div>{{ $globalData.titleName }}</div>
      <div>{{ $globalData.textTitleName }}</div>
    </nav>
    <section class="examMode">
      <div @click="goLogin(0)">考试模式</div>
      <div @click="goLogin(1)">练习模式</div>
    </section>
  </div>
</template>

<script>
import SpeakTts from "speak-tts";
export default {
  name: "",
  data() {
    return {
      tts: new SpeakTts(),
    };
  },
  mounted() {
    this.tts.speak({
      text: "1111",
      queue: false,
      listeners: {
        onend: () => {},
        onerror: (e) => {
          console.error("语音播放错误", e);
        },
      },
    });
  },
  methods: {
    goLogin(type) {
      localStorage.setItem("textType", type);
      this.$router.push({ name: "Login" });
    },
  },
};
</script>

<style scoped>
@import url(../style/home.scss);
</style>
